# 1. 首页搜索操作
# 2. 注册操作
# 3. 登录操作
import time
from selenium import webdriver
from selenium.webdriver.common.by import By


class Case():
    def __init__(self):
        self.driver = webdriver.Chrome()
        self.driver.get("https://ecshop.test2.shopex123.com")

    def search(self):
        # 定位搜索框，输入关键字
        self.driver.find_element(By.CSS_SELECTOR, 'input[id="keyword"]').send_keys("资生堂")
        self.driver.find_element(By.CSS_SELECTOR, 'input[name="imageField"]').click()

    def quit(self, seconds=3):
        time.sleep(seconds)
        self.driver.quit()


if __name__ == '__main__':
    case = Case()
    case.search()
    case.quit()
